home *** CD-ROM | disk | FTP | other *** search
/ Programmer Plus 2007 / Programmer-Plus-2007.iso / Programming / XML Utilities / Professional Programmer XSL IDE / Xselerator25.msi / Data.Cab / F26232_CreateSubsetSorted.xsl < prev    next >
Encoding:
Extensible Markup Language  |  2001-10-04  |  1.2 KB  |  34 lines

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <!-- ===========================================================
  3.   Category:       XMLtoXML
  4.   Author:         David Silverlight
  5.                   HeadGeek@xmlpitstop.com
  6.   Created:        2001-05-16
  7.   Description:-
  8.     This stylsheet will create an output of attributes from a
  9.     set of sorted elements.  Each element generated will contain
  10.     only specific attributes for customers sorted by countryname.
  11. ================================================================ -->
  12. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"><xsl:output method="xml"/>
  13.  
  14. <xsl:template match="/">
  15.     <customers>
  16.     <xsl:apply-templates/>
  17.     </customers>
  18. </xsl:template>
  19.  
  20.  
  21. <xsl:template match="customers">
  22.     <xsl:for-each select="customer">
  23.      <xsl:sort select="@Country" order="ascending"/>
  24.     <customer>
  25.         <xsl:attribute name="CompanyName" ><xsl:value-of select="@CompanyName"/></xsl:attribute>
  26.         <xsl:attribute name="CustomerID" ><xsl:value-of select="@CustomerID"/></xsl:attribute>
  27.         <xsl:attribute name="Country" ><xsl:value-of select="@Country"/></xsl:attribute>
  28.     </customer>
  29.     </xsl:for-each>
  30.  
  31. </xsl:template>
  32.  
  33.  
  34. </xsl:stylesheet>